#include <bits/stdc++.h>

using namespace std;

int main_6()
{
    int n=52;
    int kbits=(int)ceil(log2(n+1));
    char str[10];
    itoa(n,str,2);
    printf("%s\n",str);
    printf("%d\n",kbits);//k bits
    for (int i=0;i<kbits ;++i )
    {
        printf("The %d bit is %d\n",i,(n>>i)&1);
    }
    for (int i=1;i<=kbits ;++i )
    {
        itoa(n&((1<<i)-1),str,2);
        printf("The last %d bits are %0*s\n",i,i,str);
    }
    printf("%x\n",n^(1<<0));
	return 0;
}
